#ifndef TLS_LINEAR_AGGR_H
#define TLS_LINEAR_AGGR_H
#include "triangle.h"
#include <vector>
#include <cstdio>

namespace tls{

  struct linear_aggr{
    std::vector<vec4> verts;
    std::vector<triangle> faces;

    bool intersect(ray& r,isect& hit)const{
      bool bhit=false;
      for(int i=0;i<faces.size();++i)
	if(faces[i].intersect(r,hit)) bhit=true;
      return bhit;
    }

    bool intersectP(ray& r)const{
      isect t;
      for(int i=0;i<faces.size();++i)
	if(faces[i].intersect(r,t)) return true;
      return false;
    }
  };

}//namespace tls

#endif
